package com.oa.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.oa.entity.Admin;
import com.oa.mapper.AdminMapper;
import com.oa.service.IAdminService;
import org.springframework.stereotype.Service;

@Service
public class AdminServiceImpl extends ServiceImpl<AdminMapper, Admin> implements IAdminService {


    @Override
    public Admin login(String username, String pwd) {
        QueryWrapper<Admin> queryWrapper=new QueryWrapper<>();
        queryWrapper.eq("username",username);
        queryWrapper.eq("pwd",pwd);
        return this.getOne(queryWrapper);
    }

    @Override
    public void updatesDb(Admin admin) {
        this.updateById(admin);
    }


}
